<?php
require_once(realpath(dirname(__FILE__)."/../plogger/OutputFormatters/OutputFormatter.php"));

class HtmlFormatter extends OutputFormatter 
{
	public function format($params)
	{
		$style = $this->getStyle($params["type"]);
		$msg = "<div $style>[".$params["id"]."::".$params["file"]."::{$params["line"]}][{$params["time"]}]".$params["msg"]."</div>";
		return $msg;
	}
	
	private function getStyle($type)
	{
		$style = "";
		
		switch ($type)
		{
			case "error":
				$style = "style='font-family:Arial; color:#ff0000;'";
				break;
			case "warning":
				$style = "style='font-family:Arial; color:#d5e021;'";
				break;
			case "debug":
			default:
				$style = "style='font-family:Arial; color:#000000;'";
				break;
		}
		
		return $style;
	}
}
?>